xeffect_summary <- 
  function(model){
    tmp_dframe <- data.frame(
      param = names(model$coef),    
      beta = model$coef, 
      se = sqrt(diag(xeffect.glm(glm.obj = model,
                                 g1 = model$data$caseid,
                                 g2 = model$data$hdl_id))))
    tmp_dframe$t <- tmp_dframe$beta/tmp_dframe$se
    tmp_dframe$p <- 2*(1 - pt(abs(tmp_dframe$t), model$df.residual))
    tmp_dframe$n <- nobs(model)
    tmp_dframe$df <- model$df.residual
    tmp_dframe$r2 <- as.numeric(performance::r2(model))
    
    return(tibble(tmp_dframe))
  }